import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    name: 'Index',
    component: () => import('../views/Index.vue'),
    children: [
      {
        path: '/',
        name: 'Recommend',
        component: () => import('../views/index/Recommend.vue'),
      },
      {
        path: '/hot',
        name: 'Hot',
        component: () => import('../views/Hot.vue'),
      },
      {
        path: '/search',
        name: 'Search',
        component: () => import('../views/index/Search.vue'),
      },
    ],
  },
  {
    path: '/playlist/:id',
    name: 'Playlist',
    component: () => import('../views/playList.vue'),
  },
  {
    path: '/play/:id',
    name: 'Play',
    component: () => import('../views/play.vue'),
  },
];

const router = new VueRouter({
  linkExactActiveClass: 'active',
  routes,
});

export default router;
